import React, { Component } from 'react'
import { Route, NavLink } from 'react-router-dom'
import Detail from './Detail'

export default class News extends Component {
  render() {
    return (
      <div>
        <ul>
          <li>
            <NavLink to={{
              pathname: '/news/detail/1?name=aa',
              state: {
                // 埋点 （不要让别的发现，一般用于数据的收集统计）
                age: 20
              }
            }}>我是新闻1</NavLink>
          </li>
          <li>
            <NavLink to="/news/detail/2?name=bb">我是新闻2</NavLink>
          </li>
          <li>
            <NavLink to="/news/detail/3?name=cc">我是新闻3</NavLink>
          </li>
        </ul>
        {/* 嵌套路由 -- 了解 */}
        {/* <Route path="/news/detail/:id" component={Detail} /> */}
      </div>
    )
  }
}
